package com.yxt.qmgf.start.view;

import com.yxt.qmgf.common.IPubCost;
import com.yxt.qmgf.userinfo.ctrl.UserCreatController;
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;
import java.net.URL;

public class UserCreatWindow {

    public void start(Stage stage) {
        try {
            URL url = getClass().getResource("/fxml/UserInfo/UserCreat.fxml");
            Group root = new Group();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.setLocation(url);
            fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
            Parent parent = fxmlLoader.load();
            Scene scene = new Scene(parent, 300, 270);

            stage.setScene(scene);
            stage.setTitle("新用户注册");
            parent.getStylesheets().add(getClass().getResource(IPubCost.CSSPATH).toExternalForm());
            UserCreatController controller=fxmlLoader.getController();
            controller.setStage(stage);
        } catch (IOException e) {
            e.printStackTrace();
        }
        stage.show();

    }
}
